package com.yonyou.pmclouds.safetypatrol;

import com.alibaba.dubbo.config.annotation.Reference;
import com.yonyou.pmclouds.ApplicationConsts;
import com.yonyou.pmclouds.basecom.exception.BusinessException;
import com.yonyou.pmclouds.safetypatrol.entity.SafetypatrolDetailVO;
import com.yonyou.pmclouds.safetypatrol.service.rmiitf.SafetypatrolDetailMaintain;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/safetypatrol/detail")
public class SafetypatrolDetailController {

    public static Logger logger = LoggerFactory.getLogger(SafetypatrolController.class);

    @Reference(version = ApplicationConsts.APPLICATION_VERSION)
    private SafetypatrolDetailMaintain detailMaintain ;

    @RequestMapping("/enable")
    public SafetypatrolDetailVO enable(@RequestBody SafetypatrolDetailVO safetypatrolDetailVO) throws BusinessException {
        SafetypatrolDetailVO enableState = detailMaintain.enableState(safetypatrolDetailVO);
        return enableState;
    }

    @RequestMapping("/disable")
    public SafetypatrolDetailVO disable(@RequestBody SafetypatrolDetailVO safetypatrolDetailVO) throws BusinessException {
        SafetypatrolDetailVO disableState = detailMaintain.disableState(safetypatrolDetailVO);
        return disableState;
    }

    @RequestMapping("/delete")
    public void delete(@RequestBody SafetypatrolDetailVO safetypatrolDetailVO) throws BusinessException {
        detailMaintain.deleteDetailVO(safetypatrolDetailVO);
    }

}
